#!/bin/bash
# author: onion
# time: 202506

curr_path=$(cd $(dirname $0); pwd)

#判断ansible
isansible=`rpm -qa | grep ansible* | wc -l`
if [ $isansible -eq 0 ]; then
    rpm -ivh $curr_path/tools/ansible_package/*.rpm --nodeps --force
else
    echo "ansible存在, 跳过安装"
fi

#判断unzip命令存在
isunzip=`rpm -qa | grep unzip | wc -l`
if [ $isunzip -eq 0 ]; then
    yum localinstall -y $root_path/open_source/*.rpm
else
    echo "unzip存在, 跳过安装"
fi

echo "初始化检测完成..."
